import CodeEditor from '@uiw/react-textarea-code-editor';
import { useEffect, useState } from 'react';
import { readText } from "@linksaas-git/widget";
import { getLang } from './lang';

function App() {
  const [code, setCode] = useState("");
  const [lang, setLang] = useState("");

  useEffect(() => {
    readText().then(res => setCode(res));
    getLang().then(res => setLang(res));
  }, []);

  return (
    <CodeEditor
      value={code}
      language={lang}
      style={{
        height: "100%",
        fontSize: "16px"
      }}
    />
  )
}

export default App
